import * as React from 'react'
import * as styles from './loading.less'

// tslint:disable-next-line:no-empty-interface
export interface LoadingProps {
  error: any
  timedOut: any,
  pastDelay: any
}

export function Loading(props: LoadingProps) {
  if (props.error) {
    return <div className={styles.view}>Error!</div>
  } else if (props.timedOut) {
    return <div>Taking a long time...</div>
  } else if (props.pastDelay) {
    return <div>Loading...</div>
  } else {
    return null
  }
}
